package com.fz.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fz.core.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * <p>
 * 权限菜单表
 * </p>
 *
 * @author wangyi
 * @since 2024-08-17
 */
@Data
@TableName("t_permission")
public class TPermission extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 名称
     */
    private String name;

    /**
     * 描述
     */
    private String description;

    /**
     * 菜单路径
     */
    private String path;


    private Integer level;

    /**
     * 类别
     */
    private Integer type;


    private  Integer parentId;

    @TableField(exist=false)
    private List<TPermission> children;

    public TPermission(String name, String description, String path, Integer level, Integer parentId, Integer type) {
        this.name = name;
        this.description = description;
        this.path = path;
        this.level = level;
        this.parentId = parentId;
        this.type = type;
    }


    public TPermission(long id, String name, String description, String path, Integer level,Integer parentId, Integer type) {
        super(id);
        this.name = name;
        this.description = description;
        this.path = path;
        this.level = level;
        this.parentId = parentId;
        this.type = type;
    }


}
